SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date, ,>
-- Description:	<Description, ,>
-- =============================================
CREATE FUNCTION dbo.fnSSBPortfolioToArtemis
(
	-- Add the parameters for the function here
	@PortfolioId VARCHAR(50)
)
RETURNS VARCHAR(50)
AS
BEGIN
	-- Declare the return variable here
	DECLARE @Pf VARCHAR(50)

	SET @Pf = (
SELECT 

map.ART_PortfolioID

FROM dbo.mapSSB_PortID map
WHERE map.SSB_PortfolioID = @PortfolioId	-- Return the result of the function
	)
	RETURN @Pf

END
GO
EXEC sp_addextendedproperty N'VirtualFolder', N'Generic', 'SCHEMA', N'dbo', 'FUNCTION', N'fnSSBPortfolioToArtemis', NULL, NULL
GO
